<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title{:session('cp.cpsysname')}--服务商管理平台</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="{:config('webconfig.description');}">
    <meta name="keywords" content="{:config('webconfig.keywords');}">
    <meta name="author" content="runoob">
    <link rel="stylesheet" href="__STATIC_URL__/static/bootstrap/3.3.7/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="__STATIC_URL__/static/css/index.css"/>
    <script src="__STATIC_URL__/static/jquery/2.2.1/jquery.min.js"></script>
    <script src="__STATIC_URL__/static/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="__STATIC_URL__/static/js/commen.js"></script>
    <style>
        .nav-tabs > li > a {
            font-size: 14px;
        }

        .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus {
            color: #555;
            background-color: #f3f3f3;
            border: 1px solid #ddd;
            border-bottom-color: transparent;
            cursor: default;
        }

        .tab-content .row {
            margin-left: 0;
            margin-right: 0;
        }

        .mini-box {
            min-height: 105px;
            padding: 20px;
        }

        .bg-success {
            background-color: #23AE89;
            color: #fff;
        }

        .mini-box .box-info p {
            margin: 0;
        }

        .size-h2 {
            font-size: 30px;
        }

        #summary_1 p.text-muted {
            color: #FFF;
            text-align: right;
        }

        #summary_1 p.text-muted {
            color: #FFF;
            text-align: right;
        }

        .size-h4 {
            font-size: 18px;
        }

        .panel:last-child {
            margin-bottom: 0;
        }

        .box-info {
            padding-top: 10px;
        }

        .bg-info {
            color: #fff;
            background: #2EC1CC;
        }
    </style>
</head>
<body>
{include file='public/header'/}
<!------------------导航-------------------------->
<section id="content">
    {include file='public/left'/}
    <!--------------------------主要内容区域------------------------------------->
    <div class="content">
        <div class="page-heading mgl15 mgr15">
            <ul class="breadcrumb">
                <li>当前位置是:</li>
                <li>
                    <a href="">会员卡</a>
                </li>
                <li class="active" style="color: #02b87f;">储值卡</li>
            </ul>
        </div>
        <div class=" mgl15 mgr15">
            <div>
                <ul class="nav nav-tabs" role="tablist" id="myTabs">
                    <li role="presentation">
                        <a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">充值面额列表</a>
                    </li>
                    <li role="presentation">
                        <a href="#messages" aria-controls="messages" role="tab" data-toggle="tab">储值记录</a>
                    </li>
                    <li role="presentation">
                        <a href="#settings" aria-controls="settings" role="tab" data-toggle="tab">消费记录</a>
                    </li>
                </ul>
                <!-- Tab panes -->
                <div class="tab-content" style="padding-top: 15px;">
                    <div role="tabpanel" class="tab-pane" id="profile">
                        <form action="" id="tabform-2" method="get">
                            <input type="hidden" name="type" value="2">
                        </form>

                        <div class="panel panel-default">

                            <div class="panel-heading">

                            </div>
                            <div class="panel-body">
                                <div class="alert alert-danger" role="alert">系统会自动过滤规则中的过期卡券,已过期卡券将不会再向用户发放。</div>
                                <table class="table table-bordered">
                                    <thead>
                                    <tr>
                                        <th>ID</th>
                                        <th>商家</th>
                                        <th>会员卡</th>
                                        <th>充值(元)</th>
                                        <th>赠送金额(元)</th>
                                        <th>赠送积分</th>
                                        <th>卡券ID</th>
                                        <th>赠送卡券</th>
                                        <th>状态</th>

                                    </tr>
                                    </thead>
                                    <tbody>
                                    {volist name="givelist" id="givevo"}
                                    <tr>
                                        <td>{$givevo.id}</td>
                                        <td>{:getmomachname($givevo.top_mid)}</td>
                                        <td>{$givevo.card_id}</td>
                                        <td>{$givevo.cz_money}</td>
                                        <td>{$givevo.zs_money}</td>
                                        <td>{$givevo.bonus}</td>
                                        <td>{$givevo.zs_card_id}</td>
                                        <td>{:getgivecard($givevo.zs_card_id,0)}</td>
                                        <td>
                                            {eq name="givevo.statu" value="1"}
                                            开启
                                            {else/}
                                            关闭
                                            {/eq}
                                        </td>

                                    </tr>
                                    {/volist}

                                    </tbody>
                                </table>

                            </div>
                        </div>
                    </div>
                    <div role="tabpanel" class="tab-pane" id="messages">
                        <div class="panel panel-search panel-default" style="margin-top: 15px;">
                            <div class="panel-heading">
                                <h5 class="panel-title">
                                    <span class="glyphicon glyphicon-search pull-left" style="margin-right: 10px;"></span>查找/筛选
                                </h5>
                            </div>
                            <form action="" method="get" class="form-horizontal table-search form-search" role="form" id="tabform-3">
                                <div class="panel-body">
                                    <div class="col-sm-6 col-md-6 col-lg-4 ">
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">门店：</label>
                                            <div class="col-sm-9">
                                                <input type="hidden" name="type" value="3">
                                                <select name="mid" class="form-control">
                                                    <option value="">请选择</option>
                                                    {volist name="mach" id="mach2"}
                                                    <option value="{$mach2['id']}" {if condition="($p_data['mid'] eq $mach2['id']) and ($p_data['type'] eq '3')  "}selected {/if}>{$mach2['merchant']}</option>
                                                    {/volist}
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="panel-footer">
                                    <button type="submit" class="btn btn-primary">查找</button>
                                    <a href="javascript:;" class="btn btn-default" onclick="clearform1()">清空</a>
                                </div>
                            </form>
                        </div>
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                <h5 class="panel-title">消费记录</h5>
                            </div>
                            <div class="panel-body">
                                <table class="table table-bordered">
                                    <thead>
                                    <tr>
                                        <th>会员卡编号</th>
                                        <th>充值时间</th>
                                        <th>储值金额</th>
                                        <th>收款金额</th>
                                        <th>门店</th>
                                        <th>操作人</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    {volist name="czlist" id="czvo"}
                                    <tr>
                                        <td>{$czvo.code}</td>
                                        <td>{$czvo.create_time}</td>
                                        <td>{$czvo.add_balance}(元)</td>
                                        <td>{$czvo.pay_balance}(元)</td>
                                        <td>{$czvo.mid|getmachnames}</td>
                                        <td>{$czvo.con_username}</td>
                                    </tr>
                                    {/volist}
                                    </tbody>
                                </table>
                                {$czlist->render()}
                            </div>
                        </div>
                    </div>
                    <div role="tabpanel" class="tab-pane" id="settings">
                        <div class="panel panel-search panel-default" style="margin-top: 15px;">
                            <div class="panel-heading">
                                <h5 class="panel-title">
                                    <span class="glyphicon glyphicon-search pull-left" style="margin-right: 10px;"></span>查找/筛选
                                </h5>
                            </div>
                            <div class="panel-body">
                                <form action="" method="get" class="form-horizontal table-search form-search" role="form" id="tabform-4">
                                    <input type="hidden" name="type" value="4">
                                    <div class="col-sm-6 col-md-6 col-lg-4 ">
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">门店：</label>
                                            <div class="col-sm-9">
                                                <select name="mid" class="form-control">
                                                    <option value="">请选择</option>
                                                    {volist name="mach" id="mach3"}
                                                    <option value="{$mach3['id']}" {if condition="($p_data['mid'] eq $mach3['id']) and ($p_data['type'] eq '4') "}selected {/if}>{$mach3['merchant']}</option>
                                                    {/volist}
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                            <div class="panel-footer">
                                <a href="javascript:;" class="btn btn-primary" onclick="searchform()">查找</a>
                                <a href="javascript:;" class="btn btn-default" onclick="clearform1()">清空</a>
                            </div>
                        </div>
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                <h5 class="panel-title">消费记录</h5>
                            </div>
                            <div class="panel-body">
                                <table class="table table-bordered">
                                    <thead>
                                    <tr>
                                        <th>会员卡编号</th>
                                        <th>消费时间</th>
                                        <th>应收</th>
                                        <th>实收</th>
                                        <th>门店</th>
                                        <th>类型</th>
                                        <th>操作人</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    {volist name="hxlist" id="hxvo"}
                                    <tr>
                                        <td>{$hxvo.code}</td>
                                        <td>{$hxvo.create_time}</td>
                                        <td>{$hxvo.del_balance}(元)</td>
                                        <td>{$hxvo.del_balance}(元)</td>
                                        <td>{$hxvo.mid|getmachnames}</td>
                                        <td>{$hxvo.hx_fs}</td>
                                        <td>{$hxvo.con_username}</td>
                                    </tr>
                                    {/volist}
                                    </tbody>
                                </table>
                                {$hxlist->render()}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        {include file='public/footer'/}
    </div>
</section>
<script>
    function clearform1(){
        $("select").val("");
    }
    $(function(){
        var currentTab = "{:request()->get('type')}";
        if(!currentTab){
            $('#myTabs a[href="#profile"]').tab('show')
        }else{
            if(currentTab=='1'){
                $('#myTabs a[href="#home"]').tab('show')
            }else if(currentTab=='2'){
                $('#myTabs a[href="#profile"]').tab('show')
            }else if(currentTab=='3'){
                $('#myTabs a[href="#messages"]').tab('show')
            }else if(currentTab=='4'){
                $('#myTabs a[href="#settings"]').tab('show')
            }
        }
        $('#myTabs  a[href="#home"]').click(function (e) {
            e.preventDefault()
            $("#tabform-1").submit()
        });
        $('#myTabs  a[href="#profile"]').click(function (e) {
            e.preventDefault()
            $("#tabform-2").submit()
        });
        $('#myTabs  a[href="#messages"]').click(function (e) {
            e.preventDefault()
            $("#tabform-3").submit()
        });
        $('#myTabs  a[href="#settings"]').click(function (e) {
            e.preventDefault()
            $("#tabform-4").submit()
        })
    })
</script>
</body>

</html>
